Slim runner package#4384
Open
paveliak wants to merge 6 commits intoactions:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new “slim” runner package variant intended for scenarios where the externals (Node distribution) directory is provided out-of-band via RUNNER_EXTERNALSDIRECTORY, and publishes these slim artifacts alongside existing “full” runner packages.
Changes:
- Update packaging (
src/dev.sh) to produce additionalactions-runner-slim-*archives, excludingexternalsand using zstd compression (level 19). - Update runtime externals resolution (
HostContext.GetDirectory(Externals)) to honorRUNNER_EXTERNALSDIRECTORYwith a fallback to the in-packageexternals. - Update release workflow to compute SHA for the non-slim artifact and upload slim
.tar.zstassets to GitHub Releases.
Show a summary per file
| File | Description |
|---|---|
src/dev.sh |
Adds creation of slim runner archives and zstd compression. |
src/Runner.Common/HostContext.cs |
Allows externals directory override via RUNNER_EXTERNALSDIRECTORY. |
.github/workflows/release.yml |
Adjusts SHA computation to ignore slim artifacts and uploads slim assets. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 5
Comment on lines
+388
to
+395
| path = Environment.GetEnvironmentVariable("RUNNER_EXTERNALSDIRECTORY"); | ||
|
|
||
| if (string.IsNullOrEmpty(path)) | ||
| { | ||
| path = Path.Combine( | ||
| GetDirectory(WellKnownDirectory.Root), | ||
| Constants.Path.ExternalsDirectory); | ||
| } |
Comment on lines
387
to
+395
| case WellKnownDirectory.Externals: | ||
| path = Path.Combine( | ||
| GetDirectory(WellKnownDirectory.Root), | ||
| Constants.Path.ExternalsDirectory); | ||
| path = Environment.GetEnvironmentVariable("RUNNER_EXTERNALSDIRECTORY"); | ||
|
|
||
| if (string.IsNullOrEmpty(path)) | ||
| { | ||
| path = Path.Combine( | ||
| GetDirectory(WellKnownDirectory.Root), | ||
| Constants.Path.ExternalsDirectory); | ||
| } |
Comment on lines
109
to
113
| - run: | | ||
| file=$(ls) | ||
| file=$(ls | grep -v slim) | ||
| sha=$(sha256sum $file | awk '{ print $1 }') | ||
| echo "Computed sha256: $sha for $file" | ||
| echo "${{matrix.runtime}}-sha256=$sha" >> $GITHUB_OUTPUT |
| tar_name="${runner_pkg_name}.tar.gz" | ||
| echo "Creating $tar_name in ${LAYOUT_DIR}" | ||
| tar -czf "${tar_name}" -C "${LAYOUT_DIR}" . | ||
| slim_tar_name="${runner_slim_pkg_name}.tar.zst" |
| $POWERSHELL -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "Add-Type -Assembly \"System.IO.Compression.FileSystem\"; [System.IO.Compression.ZipFile]::CreateFromDirectory(\"${window_path}\", \"${zip_name}\")" | ||
| slim_tar_name="${runner_slim_pkg_name}.tar.zst" | ||
| echo "Creating $slim_tar_name in ${window_path}" | ||
| $POWERSHELL -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "\$env:ZSTD_CLEVEL=\"19\"; tar -cf \"${slim_tar_name}\" -C \"${window_path}\" --zstd --exclude=\"externals\" ." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds new "slim" flavor of Runner package. It differs from the existing runner package in two ways:
externalsfolder containing Node distribution is removedzstdusing compression level19When invoking runner
RUNNER_EXTERNALSDIRECTORYenvironment variable is expected to point to the directory whose structure matches theexternalsdirectory of the "full" runner package